home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 November / 1993-11.d64 / easy does it (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  142 lines

  1. 10 rem*easy does it*by hugh rountree*12/14/92*for c64 & promenade eprom device*
  2. 20 rem*enable promos v2.0 previously*lines 10-70 auto-delete when program runs*
  3. 30 rem*set w=1 in line 90 to disable sound tone*
  4. 40 printchr$(147);"       auto-deleting lines  10-70":print
  5. 50 print"10":print"20":print"30":print"40":print"50":print"60":print"70"
  6. 60 print"f 2000,dfff,00:run";chr$(19);
  7. 70 fori=1to8:poke630+i,13:next:poke198,8:poke56,32:end
  8. 80 dimh(15),w(8,3),pm(8,3),ca(7),a$(4),d$(2),r$(7),x$(4):fori=1to4:readdv(i)
  9. 90 next:fori=1to8:reade$(i):foria=1to3:readw(i,ia),pm(i,ia):next:next:w=0
  10. 100 data4096,256,16,1,"07ff",42,70,0,0,40,71,"0fff",226,70,225,7,224,7
  11. 110 data"1fff",6,14,5,14,20,14,"3fff",6,14,5,14,0,0,"7fff",230,70,229,70,0,0
  12. 120 data"ffff",226,6,0,0,0,0,"1fff",0,0,0,0,48,70,"03ff",0,0,0,0,40,7
  13. 130 tg$(0)="off)":tg$(1)=" on)":ia=48:fori=0to15:h(i)=i+ia:ifi=9thenia=55
  14. 140 next:d$(1)="compare":d$(2)="transfer":r$(1)="low unerased byte"
  15. 150 r$(2)="high byte loaded":r$(3)="high byte saved":r$(4)="high byte read"
  16. 160 r$(5)="fail address":r$(6)=r$(5):r$(7)=r$(5)
  17. 170 a$(1)="start":a$(2)="end":a$(3)="compare":a$(4)="transfer"
  18. 180 c$(1)="erasure":c$(2)="disk load":c$(3)="disk save":c$(4)="read eprom"
  19. 190 c$(5)="write eprom":c$(6)="verify eprom":c$(7)="compare ram":s$="        "
  20. 200 k$(1)="passed":k$(2)="failed":dn%=8:dn=peek(186):ifdn>7thendn%=dn
  21. 210 printchr$(147)chr$(14)s$s$"[208]romenade"
  22. 220 print:prints$"[218]ero [211]ocket---------> [218]"
  23. 230 print:prints$"[198]ill [205]emory([218]ero)---> [198]"
  24. 240 print:prints$"[195]heck [197]prom/[197]rasure-> [197]"
  25. 250 print:prints$"[204]oad [196]isk [198]ile------> [204]"
  26. 260 print:prints$"[211]ave [196]isk [198]ile------> [211]"
  27. 270 print:prints$"[211]et [197]prom [208]arameter-> [208]"
  28. 280 print:prints$"[211]et [210]am [193]ddresses--->[193][196][196]"
  29. 290 print:prints$"[210]ead [197]prom----------> [210]"
  30. 300 print:prints$"[215]rite [197]prom---------> [215]"
  31. 310 print:prints$"[215]rite [197]prom/[214]erify-->[214][197][210]"
  32. 320 print:prints$"[214]erify [197]prom/[210]am----> [214]"
  33. 330 print:prints$"  h[157][157][157]";:input c$
  34. 340 ifc$="z"thengosub540:gosub550
  35. 350 ifc$="f"thengosub540:gosub830:gosub560
  36. 360 ifc$="e"thengosub540:cm=1:gosub600:cm=0
  37. 370 ifc$="l"thengosub540:cm=2:gosub620:cm=0
  38. 380 ifc$="s"thengosub540:gosub1380:ifea<53248thencm=3:gosub650:cm=0
  39. 390 ifc$="p"thengosub540:gosub680
  40. 400 ifc$="add"thengosub540:gosub830
  41. 410 ifc$="r"thengosub540:cm=4:gosub890:cm=0
  42. 420 ifc$="w"thengosub540:cm=5:gosub900:cm=0
  43. 430 ifc$="ver"thengosub540:cm=1:gosub910:cm=0
  44. 440 ifc$="v"thengosub540:cm=6:gosub970:cm=0
  45. 450 ifc$="h"thengosub540:gosub980
  46. 460 ifc$="m"thengosub540:gosub1290
  47. 470 ifc$="i"thengosub540:gosub1300
  48. 480 ifc$="d"thengosub540:gosub1310
  49. 490 ifc$="a"thengosub540:gosub1320
  50. 500 ifc$="c"thengosub540:cm=7:gosub1350:cm=0
  51. 510 ifc$="t"thengosub540:gosub1370
  52. 520 ifc$="toggle"thengosub540:gosub1400
  53. 530 goto210
  54. 540 printchr$(147)chr$(142):return
  55. 550 z:return
  56. 560 by%=0:print"  enter value for memory fill"
  57. 570 print"  hex ($00-$ff) ";:inputb$:l=len(b$):ifl<>2thengoto560
  58. 580 h$="00"+b$:ha=0:gosub1040:ifha<0orha>255then560
  59. 590 by%=ha%:f ba%,ea%,by%:return
  60. 600 ifee%=0orcw%=0thengosub680
  61. 610 e es%,ee%,cw%:gosub1220:return
  62. 620 ifba%=0thengosub830
  63. 630 gosub1000:ifn$=""thenreturn
  64. 640 l n$,dn%,ba%:gosub1220:return
  65. 650 ifba%=0andea%=0thengosub830
  66. 660 gosub1000:ifn$=""thenreturn
  67. 670 s n$,dn%,ba%,ea%:gosub1220:return
  68. 680 print"  enter program volts(12.5/21/25)":print"  ";:inputv$
  69. 690 ifv$<>"12.5"andv$<>"21"andv$<>"25"thengoto680
  70. 700 pv=1:ifval(v$)>12.5thenpv=2:ifval(v$)>21thenpv=3
  71. 710 print:print"  enter eprom type(2758/2716/2732/2764)"
  72. 720 print"  (27128/27256/27512/68764/68766/68769)"
  73. 730 print"  ";:inputp$:ifp$="68764"orp$="68769"thenp$="68766"
  74. 740 ok=1:ifp$<>"2758"andp$<>"2716"andp$<>"2732"andp$<>"2764"thenok=0
  75. 750 ifok=0andp$<>"27128"andp$<>"27256"andp$<>"27512"andp$<>"68766"thengoto710
  76. 760 bt=16:s=1:print"  ";:l=len(p$):et=val(right$(p$,l-2)):ml=2:gosub1130
  77. 770 print:ifcw%=0orpm%=0thengosub1160:goto680
  78. 780 h$=e$(s):ea$(2)=h$:ha=0:gosub1040:ma=ha:ee%=ha%:a1=1:gosub790:es%=ha%:return
  79. 790 print"  enter eprom "a$(a1)" address":e$=h$:ifa1=1thenla=0:e$="00"
  80. 800 print"  ($"e$"-$";e$(s);") ";:inputea$(a1)
  81. 810 print:h$=right$("0000"+ea$(a1),4):ha=0:gosub1040:ifha<laorha>mathen790
  82. 820 return
  83. 830 a1=1:ca=8192:gosub840:ba=ha:ba%=ha%:a1=2:ca=ba:gosub840:ea=ha:ea%=ha%:return
  84. 840 print"  enter ram "a$(a1)" hex address":x$=x$(1):ifa1<>2thenx$="2000"
  85. 850 print"  $"x$"-$dfff) ";:inputx$(a1):print
  86. 860 l=len(x$(a1)):ifl<>4then840
  87. 870 h$=x$(a1):ha=0:gosub1040:ifha<caorha>57343then840
  88. 880 return
  89. 890 gosub930:r ba%,ea%,es%,cw%:gosub1220:return
  90. 900 gosub930:gosub960:return
  91. 910 gosub600:cm=5:ifck=2then1170
  92. 920 gosub930:gosub960:cm=6:gosub970:return
  93. 930 ifba%=0orea%=0thengosub830
  94. 940 ifcw%=0orpm%=0thengosub680
  95. 950 return
  96. 960 p ba%,ea%,es%,cw%,pm%:gosub1220:return
  97. 970 gosub930:v ba%,ea%,es%,cw%:gosub1220:return
  98. 980 prints$"   command  addendum":print:print"       ( m / i / d / a / c / t )"
  99. 990 print:prints$" toggle (checksum "tg$(tg):goto1170
  100. 1000 n$="":print:print"  enter filename"
  101. 1010 print"  ";:inputn$:print:ifn$=""thenreturn
  102. 1020 ifn$=","orn$="?"orn$="*"orn$="@"orn$=";"orn$="."thengoto1000
  103. 1030 return
  104. 1040 l=len(h$):fori=lto1step-1:b=16:a=asc(mid$(h$,i,1)):ifa>47anda<58then1060
  105. 1050 fa=0:ifa<65ora>70thenfa=1:goto1070
  106. 1060 gosub1090
  107. 1070 nexti:iffathenfa=0:ha=-1:return
  108. 1080 gosub1120:return
  109. 1090 b=b-1:ifh(b)>athen1090
  110. 1100 gosub1110:return
  111. 1110 ha=ha+(b*dv(i)):return
  112. 1120 ha%=ha+65536*(ha>32767):return
  113. 1130 re=et-bt:bt=bt*ml:ifrethens=s+1:ifs>6thenml=1:bt=766:ifs>7thenbt=58
  114. 1140 ifrethengoto1130
  115. 1150 cw%=w(s,pv):pm%=pm(s,pv):gosub1040:ml=2:return
  116. 1160 prints$"selected eprom type and":prints$"pgm. voltage not valid."
  117. 1170 print:print"      -press any key to continue-":print:ifwthen1200
  118. 1180 poke54296,15:poke54278,89:poke54276,33
  119. 1190 poke54273,34:poke54272,75:fori=1to100:next:poke54273,45:poke54272,90
  120. 1200 geta$:ifa$=""thenonw+1goto1190,1200
  121. 1210 poke54296,0:return
  122. 1220 ad=peek(166)+256*peek(167)
  123. 1230 ifpeek(165)=0thenck=1:ifcm>4then1260
  124. 1240 print:ifpeek(165)=255thenck=2
  125. 1250 ifcm>1orck=2thenprint" "ad"= address of "r$(cm)
  126. 1260 poke165,0:poke166,0:poke167,0:ifcm<>4thenprint"  "c$(cm)" command "k$(ck)
  127. 1270 ifc$="ver"thenifcm=1orcm=5thenreturn
  128. 1280 goto1170
  129. 1290 gosub830:m ba%,ea%:print:goto1170
  130. 1300 gosub830:i ba%,ea%:print:goto1170
  131. 1310 gosub1330:d es%,ee%,cw%:goto1170
  132. 1320 gosub1330:a es%,ee%,cw%:goto1170
  133. 1330 print:ifcw%=0thengosub680
  134. 1340 a1=1:gosub790:es%=ha%:la=ha:a1=2:gosub790:ee%=ha%:return
  135. 1350 gosub830:ca=8192:la=57343:a1=3:gosub840:ct%=ha%
  136. 1360 c ba%,ea%,ct%:print:gosub1220:return
  137. 1370 gosub830:ca=8192:a1=4:gosub840:ct%=ha%:t ba%,ea%,ct%:print:return
  138. 1380 ifea>53247thenprint"  -data save not allowed above $cfff-":print:gosub1170
  139. 1390 return
  140. 1400 tg=tg+1:tg%=128:iftg>1thentg=0:tg%=0
  141. 1410 poke157,tg%:gosub990:return
  142.